import http from "@/http"
import {costPlan,costDetailList,costPlanListParam,additionalTableData} from '@/api/costPricingPlan/type.ts'

// 电控成本核价单分页列表查询
export const queryCostPlanListApi = (data: costPlanListParam) => {
    return http.get("/costPricingPlan/queryCostPlanList", data)
}

// 电控成本核价单删除接口
export const deleteApi = (id:number) => {
    return http.delete("/costPricingPlan/deleteCostPricingPlan/"+id)
}

// 保存电控成本报价单
export const submitCreateCostPricingPlanApi = (data: costPlan) => {
    return http.post("/costPricingPlan/saveCostPricingPlan", data)
}

// 修改电控成本报价单
export const submitUpdateCostPlan = (data: costPlan) => {
    return http.put("/costPricingPlan/updateCostPricingPlan", data)
}

// 查询电控成本报价单详情
export const getSoftwarePlanApi = (id: string | number) => {
    return http.get("/costPricingPlan/getCostPricingPlan/"+id)
}


// 根据分类查询对的固定项表格
export const getCostTemplate = (type: string,data:costDetailList[],costTemplateList:additionalTableData[] ) => {
    return http.post("/costPricingPlan/getCostTemplate",{
        type,
        costDetailList:data,
        costTemplateList:costTemplateList
    })
}

// 删除成本核价方案
export const deleteCostPricingPlan = (id: number) => {
  return http.delete("/costPricingPlan/deleteCostPricingPlan/"+id)
}

// 更新成本核价状态
export const updateStatusApi = (params: { id: number; activate: number }) => {
  return http.put("/costPricingPlan/updateStatus", params)
}
